import Vue from 'vue'
import VueRouter from 'vue-router'

import djRadio from '../views/djRadio/index'
import singed from '../views/Artist/singed'
import artistList from '../views/Artist/artistList'
Vue.use(VueRouter)

const routes = [
  {
    path: '/discover',
    name: 'Discover',
    component: () => import('@/views/Discover/RecommendList')
    // children:[
    // 排行榜
    //   {
    //     path:"toplist",
    //     name:"TopList",
    //     component:()=>import("@/views/Discover/Ranking")
    //   },
    // 歌单
    //   {
    //     path:'playlist',
    //     name:'Playlist',
    //     component:()=>import('@/views/playlist')
    //   },
    //   // 主播电台
    //   {
    //     path: 'djRadio',
    //     name: 'djRadio',
    //     component: djRadio
    //   },
    // ]
  },
  {
    path: '/songdetail',
    name: 'SongDetail',
    component: () => import('@/views/songdetail')
  },
  // 排行榜
  {
    path: '/discover/toplist',
    name: 'TopList',
    component: () => import('@/views/Discover/Ranking')
  },
  // 歌单
  {
    path: '/discover/playlist',
    name: 'Playlist',
    component: () => import('@/views/playlist')
  },
  // 主播电台
  {
    path: '/discover/djRadio',
    name: 'djRadio',
    component: djRadio
  },
  // 新碟上架
  {
    path: '/discover/album',
    name: 'album',
    component: () => import('@/views/album')
  },
  // 歌手
  {
    path: '/discover/artist',
    name: 'Artist',
    component: () => import('@/views/Artist')
  },
  // 入驻歌手
  {
    path: '/discover/artist/singed',
    name: 'singed',
    component: singed
  },
  {
    path: '/discover/artist/artistlist',
    name: 'artistList',
    component: artistList
  },
  {
    path: '/',
    name: 'Discover',
    component: () => import('@/views/Discover/RecommendList')
  },
  {
    path: '/discover/mymusic',
    name: 'Mymusic',
    component: () => import('@/views/mymusic')
  },
  {
    path: '/discover/friend',
    name: 'Friend',
    component: () => import('@/views/friend')
  }
]

const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  routes,
  scrollBehavior: () => ({ y: 0 })
})

export default router
